/**
 *
 */
package net.jadoth.util;

/**
 * @author Thomas Muenz
 *
 */
public interface KeyValue<K,V>
{
	public K key();
	public V value();
	
	
	public class Implementation<K,V> extends Pair.Implementation<K, V>
	{		
		public Implementation(final K key, final V val)
		{
			super(key, val);
		}
		/**
		 * @return a String of pattern <code>[<i>key</i> -> <i>value</i>]</code>
		 */
		@Override
		public String toString()
		{
			// self-reference can never occur as this implementation is immutable
			return '['+String.valueOf(this.key())+" -> "+String.valueOf(this.value())+']';
		}
		
	}
}
